<template>
  <a-card :bordered="false">

    <!-- 查询区域 -->
    <div class="table-page-search-wrapper search-box-cuesList">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="数据名称">
              <a-input placeholder="请输入"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="4" :sm="6">
            <a-form-item label="确认状态">
              <a-select placeholder="请选择">
                <a-select-option value="1">未确认</a-select-option>
                <a-select-option value="2">已确认</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
              </a>
            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>

    <!-- table区域-begin -->
    <div>
      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a @click="handleToDetail(record)">详情</a>
        </span>
      </a-table>
    </div>
    <!-- table区域-end -->
    <person-performance-month-view ref="personPerformanceMonthView"></person-performance-month-view>
  </a-card>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { USER_INFO } from '@/store/mutation-types'
import Vue from 'vue'
import PersonPerformanceMonthView from './modules/PersonPerformanceMonthView'

export default {
  name: 'PersonPerformance',
  mixins: [JeecgListMixin],
  components: {
    PersonPerformanceMonthView
  },
  data() {
    return {
      departList: [],
      allMonthList: [],
      description: 'PerformanceMonth管理页面',

      // 表头
      columns: [
        {
          title: '工号',
          align: 'center',
          dataIndex: 'workNo'
        },
        {
          title: '姓名',
          align: 'center',
          dataIndex: 'realname'
        },
        {
          title: '岗级',
          align: 'center',
          dataIndex: 'postName'
        },
        {
          title: '岗位',
          align: 'center',
          dataInde: 'roleName'
        },
        {
          title: '岗位绩效',
          align: 'center',
          dataInde: 'postPerforName'
        },
        {
          title: '薪资属性',
          align: 'center',
          dataIndex: 'salaryTypeName'
        },
        {
          title: '考评周期',
          align: 'center',
          customRender: data => {
            return `${data.startTime} - ${data.endTime}`
          }
        },
        {
          title: '时效绩效',
          align: 'center',
          dataIndex: 'timeScore'
        },
        {
          title: '传播绩效',
          align: 'center',
          dataIndex: 'spreadScore'
        },
        {
          title: '其他绩效',
          align: 'center',
          dataIndex: 'otherScore'
        },
        {
          title: '绩效总分',
          align: 'center',
          dataIndex: 'totalScore'
        },
        {
          title: '绩效奖金/元',
          align: 'center',
          dataIndex: 'scoreAmount'
        },
        {
          title: '基础薪资/元',
          align: 'center',
          dataIndex: 'baseAmount'
        },
        {
          title: '行政调整/元',
          align: 'center',
          dataIndex: 'adminAdjust'
        },
        {
          title: '部门调整/元',
          align: 'center',
          dataIndex: 'departAdjust'
        },
        {
          title: '实发薪资/元',
          align: 'center',
          dataIndex: 'salary'
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: '/performance/performanceMonthDetail/personalList'
      },
      userInfo: null
    }
  },
  created() {},
  mounted() {},
  methods: {
    handleToDetail(record) {
      this.$refs.personPerformanceMonthView.edit(record)
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>